package com;

import java.math.BigDecimal;
import java.util.Date;

public class TestCostTIme {

	public static void main(String[] args) {
		Date fuDate = new Date();
		int maxLoop = 100000;
		BigDecimal total = BigDecimal.ZERO;
		for(int i=0;i<maxLoop;i++) {
			total = total.add(new BigDecimal(String.valueOf(i)));
		}
		System.out.println(total.toString());
		Long diff = new Date().getTime() - fuDate.getTime();
		System.out.println(diff);
		System.out.println(diff / 1000);
		
		total = BigDecimal.ONE;
		for(int i=1;i<=maxLoop;i++) {
			total = total.multiply(new BigDecimal(String.valueOf(i)));
		}
		System.out.println(total.toString());
		
		diff = new Date().getTime() - fuDate.getTime();
		System.out.println(diff);
		System.out.println(diff / 1000);
	}
}
